*-------------------------------------------------------------------------------
* Price and Wasserman (2024), "The Summer Drop in Female Employment"
*
* Description: Map 3-digit 1990 Census occupation codes into 2-digit codes.
*-------------------------------------------------------------------------------


* Map 3-digit occs into 2-digit occs
gen occ1990_2d = .
quietly replace occ1990_2d =  0 if inrange(occ1990,   3,  22)
quietly replace occ1990_2d =  1 if inrange(occ1990,  23,  37)
quietly replace occ1990_2d =  2 if inrange(occ1990,  43,  59)
quietly replace occ1990_2d =  3 if inrange(occ1990,  64,  68)
quietly replace occ1990_2d =  4 if inrange(occ1990,  69,  83)
quietly replace occ1990_2d =  5 if inrange(occ1990,  84,  89)
quietly replace occ1990_2d =  6 if inrange(occ1990,  95,  97)
quietly replace occ1990_2d =  7 if inrange(occ1990,  98, 106)
quietly replace occ1990_2d =  8 if inrange(occ1990, 113, 154)
quietly replace occ1990_2d =  9 if inrange(occ1990, 155, 163)
quietly replace occ1990_2d = 10 if inrange(occ1990, 164, 165)
quietly replace occ1990_2d = 11 if inrange(occ1990, 166, 173)
quietly replace occ1990_2d = 12 if inrange(occ1990, 174, 176)
quietly replace occ1990_2d = 13 if inrange(occ1990, 178, 179)
quietly replace occ1990_2d = 14 if inrange(occ1990, 183, 200)
quietly replace occ1990_2d = 15 if inrange(occ1990, 203, 208)
quietly replace occ1990_2d = 16 if inrange(occ1990, 213, 225)
quietly replace occ1990_2d = 17 if inrange(occ1990, 226, 235)
quietly replace occ1990_2d = 18 if inrange(occ1990, 243, 256)
quietly replace occ1990_2d = 19 if inrange(occ1990, 258, 277)
quietly replace occ1990_2d = 20 if inrange(occ1990, 283, 290)
quietly replace occ1990_2d = 21 if inrange(occ1990, 303, 308)
quietly replace occ1990_2d = 22 if inrange(occ1990, 313, 315)
quietly replace occ1990_2d = 23 if inrange(occ1990, 316, 323)
quietly replace occ1990_2d = 24 if inrange(occ1990, 326, 336)
quietly replace occ1990_2d = 25 if inrange(occ1990, 337, 344)
quietly replace occ1990_2d = 26 if inrange(occ1990, 345, 347)
quietly replace occ1990_2d = 27 if inrange(occ1990, 348, 349)
quietly replace occ1990_2d = 28 if inrange(occ1990, 354, 357)
quietly replace occ1990_2d = 29 if inrange(occ1990, 359, 373)
quietly replace occ1990_2d = 30 if inrange(occ1990, 375, 378)
quietly replace occ1990_2d = 31 if inrange(occ1990, 379, 391)
quietly replace occ1990_2d = 32 if inrange(occ1990, 405, 408)
quietly replace occ1990_2d = 33 if inrange(occ1990, 415, 423)
quietly replace occ1990_2d = 34 if inrange(occ1990, 425, 427)
quietly replace occ1990_2d = 35 if inrange(occ1990, 434, 444)
quietly replace occ1990_2d = 36 if inrange(occ1990, 445, 447)
quietly replace occ1990_2d = 37 if inrange(occ1990, 448, 455)
quietly replace occ1990_2d = 38 if inrange(occ1990, 456, 469)
quietly replace occ1990_2d = 39 if inrange(occ1990, 473, 476)
quietly replace occ1990_2d = 40 if inrange(occ1990, 479, 484)
quietly replace occ1990_2d = 41 if inrange(occ1990, 485, 489)
quietly replace occ1990_2d = 42 if occ1990 == 496
quietly replace occ1990_2d = 43 if occ1990 ==  498
quietly replace occ1990_2d = 44 if occ1990 ==  503
quietly replace occ1990_2d = 45 if inrange(occ1990, 505, 519)
quietly replace occ1990_2d = 46 if inrange(occ1990, 523, 534)
quietly replace occ1990_2d = 47 if inrange(occ1990, 535, 549)
quietly replace occ1990_2d = 48 if occ1990 == 558
quietly replace occ1990_2d = 49 if inrange(occ1990, 563, 599)
quietly replace occ1990_2d = 50 if inrange(occ1990, 614, 617)
quietly replace occ1990_2d = 51 if occ1990 ==  628
quietly replace occ1990_2d = 52 if inrange(occ1990, 634, 653)
quietly replace occ1990_2d = 53 if inrange(occ1990, 657, 659)
quietly replace occ1990_2d = 54 if inrange(occ1990, 666, 674)
quietly replace occ1990_2d = 55 if inrange(occ1990, 675, 684)
quietly replace occ1990_2d = 56 if inrange(occ1990, 686, 688)
quietly replace occ1990_2d = 57 if occ1990 == 693
quietly replace occ1990_2d = 58 if inrange(occ1990, 694, 699)
quietly replace occ1990_2d = 59 if inrange(occ1990, 703, 717)
quietly replace occ1990_2d = 60 if inrange(occ1990, 719, 724)
quietly replace occ1990_2d = 61 if inrange(occ1990, 726, 733)
quietly replace occ1990_2d = 62 if inrange(occ1990, 703, 717)
quietly replace occ1990_2d = 63 if inrange(occ1990, 719, 724)
quietly replace occ1990_2d = 64 if inrange(occ1990, 726, 733)
quietly replace occ1990_2d = 65 if inrange(occ1990, 734, 736)
quietly replace occ1990_2d = 66 if inrange(occ1990, 738, 749)
quietly replace occ1990_2d = 67 if inrange(occ1990, 753, 779)
quietly replace occ1990_2d = 68 if inrange(occ1990, 783, 789)
quietly replace occ1990_2d = 69 if inrange(occ1990, 796, 799)
quietly replace occ1990_2d = 70 if inrange(occ1990, 803, 815)
quietly replace occ1990_2d = 71 if inrange(occ1990, 823, 825)
quietly replace occ1990_2d = 72 if inrange(occ1990, 829, 834)
quietly replace occ1990_2d = 73 if inrange(occ1990, 844, 859)
quietly replace occ1990_2d = 74 if inrange(occ1990, 865, 874)
quietly replace occ1990_2d = 75 if inrange(occ1990, 875, 890)
quietly replace occ1990_2d = 76 if occ1990 == 905

* Label each category
label define occ1990_2d_lbl  0 "Executive, administrative, and managerial occupations", replace
label define occ1990_2d_lbl  1 "Management related occupations", add
label define occ1990_2d_lbl  2 "Engineers, architects, and surveyors", add
label define occ1990_2d_lbl  3 "Mathematical and computer scientists", add
label define occ1990_2d_lbl  4 "Natural scientists", add
label define occ1990_2d_lbl  5 "Health diagnosing occupations", add
label define occ1990_2d_lbl  6 "Health assessment and treating occupations", add
label define occ1990_2d_lbl  7 "Therapists", add
label define occ1990_2d_lbl  8 "Teachers, postsecondary", add
label define occ1990_2d_lbl  9 "Teachers, except postsecondary", add
label define occ1990_2d_lbl 10 "Librarians, archivists, and curators", add
label define occ1990_2d_lbl 11 "Social scientists and urban planners", add
label define occ1990_2d_lbl 12 "Social, recreation, and religious workers", add
label define occ1990_2d_lbl 13 "Lawyers and judges", add
label define occ1990_2d_lbl 14 "Writers, artists, entertainers, and athletes", add
label define occ1990_2d_lbl 15 "Health technologists and technicians", add
label define occ1990_2d_lbl 16 "Technologists and technicians, except health", add
label define occ1990_2d_lbl 17 "Technicians, except health, engineering, and science", add
label define occ1990_2d_lbl 18 "Sales representatives, finance and business services", add
label define occ1990_2d_lbl 19 "Sales representatives, commodities", add
label define occ1990_2d_lbl 20 "Sales related occupations", add
label define occ1990_2d_lbl 21 "Supervisors, administrative support occupations", add
label define occ1990_2d_lbl 22 "Secretaries, stenographers, and typists", add
label define occ1990_2d_lbl 23 "Information clerks", add
label define occ1990_2d_lbl 24 "Records processing occupations, except financial", add
label define occ1990_2d_lbl 25 "Financial records processing occupations", add
label define occ1990_2d_lbl 26 "Duplicating, mail, and other office machine operators", add
label define occ1990_2d_lbl 27 "Communications equipment operators", add
label define occ1990_2d_lbl 28 "Mail and message distributing occupations", add
label define occ1990_2d_lbl 29 "Material recording, scheduling, and distributing clerks", add
label define occ1990_2d_lbl 30 "Adjusters and investigators", add
label define occ1990_2d_lbl 31 "Miscellaneous administrative support occupations", add
label define occ1990_2d_lbl 32 "Private household occupations", add
label define occ1990_2d_lbl 33 "Supervisors, protective service occupations", add
label define occ1990_2d_lbl 34 "Guards", add
label define occ1990_2d_lbl 35 "Food preparation and service occupations", add
label define occ1990_2d_lbl 36 "Health service occupations", add
label define occ1990_2d_lbl 37 "Cleaning and building service occupations, except households", add
label define occ1990_2d_lbl 38 "Personal service occupations", add
label define occ1990_2d_lbl 39 "Farm operators and managers", add
label define occ1990_2d_lbl 40 "Farm occupations, except managerial", add
label define occ1990_2d_lbl 41 "Related agricultural occupations", add
label define occ1990_2d_lbl 42 "Forestry and logging occupations", add
label define occ1990_2d_lbl 43 "Fishers, hunters, and trappers", add
label define occ1990_2d_lbl 44 "Supervisors of mechanics and repairers", add
label define occ1990_2d_lbl 45 "Mechanics and repairers, except supervisors", add
label define occ1990_2d_lbl 46 "Electrical and electronic equipment repairers", add
label define occ1990_2d_lbl 47 "Miscellaneous mechanics and repairers", add
label define occ1990_2d_lbl 48 "Supervisors, construction occupations", add
label define occ1990_2d_lbl 49 "Construction trades, except supervisors", add
label define occ1990_2d_lbl 50 "Extractive occupations", add
label define occ1990_2d_lbl 51 "Precision production occupations", add
label define occ1990_2d_lbl 52 "Precision metal working occupations", add
label define occ1990_2d_lbl 53 "Precision woodworking occupations", add
label define occ1990_2d_lbl 54 "Precision textile, apparel, and furnishings machine workers", add
label define occ1990_2d_lbl 55 "Precision workers, assorted materials", add
label define occ1990_2d_lbl 56 "Precision food production occupations", add
label define occ1990_2d_lbl 57 "Precision inspectors, testers, and related workers", add
label define occ1990_2d_lbl 58 "Plant and system operators", add
label define occ1990_2d_lbl 59 "Metal working and plastic working machine operators", add
label define occ1990_2d_lbl 60 "Metal and plastic processing machine operators", add
label define occ1990_2d_lbl 61 "Woodworking machine operators", add
label define occ1990_2d_lbl 62 "Metal working and plastic working machine operators", add
label define occ1990_2d_lbl 63 "Metal and plastic processing machine operators", add
label define occ1990_2d_lbl 64 "Woodworking machine operators", add
label define occ1990_2d_lbl 65 "Printing machine operators", add
label define occ1990_2d_lbl 66 "Textile, apparel, and furnishings machine operators", add
label define occ1990_2d_lbl 67 "Machine operators, assorted materials", add
label define occ1990_2d_lbl 68 "Fabricators, assemblers, and hand working occupations", add
label define occ1990_2d_lbl 69 "Production inspectors, testers, samplers, and weighers", add
label define occ1990_2d_lbl 70 "Motor vehicle operators", add
label define occ1990_2d_lbl 71 "Rail transportation occupations", add
label define occ1990_2d_lbl 72 "Water transportation occupations", add
label define occ1990_2d_lbl 73 "Material moving equipment operators", add
label define occ1990_2d_lbl 74 "Helpers, construction and extractive occupations", add
label define occ1990_2d_lbl 75 "Freight, stock, and material handlers", add
label define occ1990_2d_lbl 76 "Military occupations", add

* Apply the value label
label values occ1990_2d occ1990_2d_lbl
